<script type="text/javascript">

function foo(someDiv,color)
{
	someDiv.className="hourSectionTaken";
	someDiv.style.backgroundColor=color;
}


function createBubble(someDiv)
{
	if (someDiv.courseName)
        {
		var elem=document.getElementById('courseBubble'); 
		elem.style.width=80;
		elem.style.height=80;
		elem.innerHTML="�� �����: "+someDiv.courseName+"\n"+"����: "+someDiv.hours+"\n����: "+someDiv.teacher+"\n���: "+someDiv.room;
	}
}

function moveBubble()
{
	var elem=document.getElementById('courseBubble'); 
	elem.style.position="absolute";
	elem.style.left=event.clientX + document.body.scrollLeft;
	elem.style.top= event.clientY + document.body.scrollTop;
}
function deleteBubble()
{
	var elem=document.getElementById('courseBubble'); 
	elem.style.width=0;
	elem.style.height=0;
	elem.innerHTML="";
}
function processMessage(str)
{
	var info = str.split("@");
	var day = findDay(info[0]);
	var hours = info[1].split("-");
	for (var i = parseInt(hours[0],10);i<parseInt(hours[1],10);++i)
	{
		var index=i;
		if (i>20) index = 20;
		var elem = document.getElementById(day+index);
		elem.courseName=info[2];
		elem.innerHTML=elem.courseName;
		elem.teacher= info[4];
		elem.room=info[5];
		elem.hours= info[1];
		if (info[3] == "0") elem.style.backgroundColor="cd3333"; //0 is a lecture, 1 is recriation
		else elem.style.backgroundColor="ffff00";
	}
}

function findDay(str)
{
	switch(str)
	{
		case "א'": return "sun";
		case "ה'": return "mon";
		case "ג'": return "tus";
	        case "ג'": return "wen";
		case "ה'": return "thu";	
	}
}

document.onmousemove= moveBubble;

</script>

<style>
div.hourSectionEmpty
{
	width=50px;
	height=25px;
	float=right; 
	border-bottom=1px solid black;
	background-color="00FF00";
	font-size= 16;
	text-align=right;
	
}
div.hourSectionTaken
{
	background-color="FF0000";	
	width=50px;
	height=25px;
        float=right;
        text-align=right;	
	

}
div.hoursCol
{
	width=35px;
	height=25px;
	float=right; 
	border-bottom=1px solid black;
	background-color="9e9e9e"; 
	font-size= 16;
	font-weight = bold;
	text-align=right;
}
div.hoursTitle
{
	width=35px;
	height=25px;
	float=right; 
	border-bottom=1px solid black;
	background-color="4682b4"; 
	font-size= 16;
	font-weight = bold;
	text-align=right;
}
div.titlesrow
{
	width=50px;
	height=25px;
	float=right; 
	border-bottom=1px solid black;
	background-color="4682b4"; 
	font-size= 16;
	font-weight = bold;
	text-align=right;
}

div.bubbleStyle
{
	width=0px;
	height=0px;
	background-color="ffffff";
	font-size= 12;
	text-align=right;
}
</style>

<div class=bubbleStyle id=courseBubble></div>

<div id=container style="width:300px; height:352px; float:right;">
	<div id=hours style="width:35px; height:350px; float:right; border:1px solid black;">
		<div class=hoursTitle id=hoursTitle  >שעות</div>
		<div class=hoursCol id=h8 >8</div>
		<div class=hoursCol id=h9 >9</div>
		<div class=hoursCol id=h10 >10</div>
		<div class=hoursCol id=h11  >11</div>
		<div class=hoursCol id=h12  >12</div>
		<div class=hoursCol id=h13 >13</div>
		<div class=hoursCol id=h14 >14</div>
		<div class=hoursCol id=h15  >15</div>
		<div class=hoursCol id=h16 >16</div>
		<div class=hoursCol id=h17 >17</div>
		<div class=hoursCol id=h18  >18</div>
		<div class=hoursCol id=h19  >19</div>
		<div class=hoursCol id=h20 >20 + </div>
	</div>
	<div id=sun style="width:50px; height:350px; float:right; border:1px solid black;">
		<div class=titlesrow id=hoursTitle  >יום א</div>
		<div class=hourSectionEmpty id=sun8 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=sun9 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=sun10 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=sun11 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=sun12 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=sun13 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=sun14 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=sun15 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=sun16 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=sun17 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=sun18 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=sun19 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=sun20 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
	</div>
	<div id=mon style="width:50px; height:350px; float:right; border:1px solid black;">
		<div class=titlesrow id=hoursTitle  >יום ב</div>
		<div class=hourSectionEmpty id=mon8 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=mon9 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=mon10 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=mon11 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=mon12 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=mon13 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=mon14 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=mon15 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=mon16 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=mon17 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=mon18 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=mon19 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=mon20 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
	</div>
	<div id=tue style="width:50px; height:350px; float:right; border:1px solid black;">
		<div class=titlesrow id=hoursTitle  >יום ג</div>
		<div class=hourSectionEmpty id=tus8 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=tus9 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=tus10 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=tus11 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=tus12 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=tus13 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=tus14 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=tus15 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=tus16 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=tus17 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=tus18 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=tus19 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=tus20 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
	</div>
	<div id=wed style="width:50px; height:350px; float:right; border:1px solid black;">
		<div class=titlesrow id=hoursTitle  >יום ד</div>
		<div class=hourSectionEmpty id=wen8 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=wen9 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=wen10 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=wen11 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=wen12 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=wen13 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=wen14 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=wen15 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=wen16 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=wen17 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=wen18 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=wen19 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=wen20 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
	</div>
	<div id=thu style="width:50px; height:350px; float:right; border:1px solid black;">
		<div class=titlesrow id=hoursTitle  >יום ה</div>
		<div class=hourSectionEmpty id=thu8 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=thu9 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=thu10 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=thu11 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=thu12 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=thu13 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=thu14 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=thu15 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=thu16 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=thu17 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=thu18 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=thu19 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
		<div class=hourSectionEmpty id=thu20 onmouseover="createBubble(this);" onmouseout="deleteBubble();"></div>
	</div>
</div>

<input id=textBox type=text name=textIn value="" onchange="processMessage(value);"/>


